]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Make the workspaces view a temporary "widget", rather than having it always
authorDan Winship <danw@src.gnome.org>
Mon, 15 Dec 2008 20:48:59 +0000 (20:48 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 15 Dec 2008 20:48:59 +0000 (20:48 +0000)
around

svn path=/trunk/; revision=124

js/ui/overlay.js
js/ui/workspaces.js

index 68095bd40ef28b3860270e72ac9fea4098106244..c6e495f190c2aaec67bda0a556575650396267aa 100644 (file)
@@ -121,9 +121,6 @@ Sideshow.prototype = {
 
     show: function() {
           this._appDisplay.show();
-    },
-
-    hide: function() {
     }
 };
 Signals.addSignalMethods(Sideshow.prototype);
@@ -155,11 +152,6 @@ Overlay.prototype = {
         // TODO - recalculate everything when desktop size changes
         this._recalculateSize();
 
-        this._workspaces = new Workspaces.Workspaces(
-            this._workspaceGridX, this._workspaceGridY,
-            this._workspaceGridWidth, this._workspaceGridHeight);
-        this._group.add_actor(this._workspaces._group);
-
         this._sideshow = new Sideshow(this._group, this._workspaceGridX - 10);
         this._sideshow.connect('activated', function(sideshow) {
             // TODO - have some sort of animation/effect while
@@ -192,8 +184,12 @@ Overlay.prototype = {
         this._recalculateSize();
 
         this._sideshow.show();
-        this._workspaces.show();
-        this._workspaces._group.raise_top();
+
+        this._workspaces = new Workspaces.Workspaces(
+            this._workspaceGridX, this._workspaceGridY,
+            this._workspaceGridWidth, this._workspaceGridHeight);
+        this._group.add_actor(this._workspaces.actor);
+        this._workspaces.actor.raise_top();
 
         // All the the actors in the window group are completely obscured,
         // hiding the group holding them while the overlay is displayed greatly
@@ -211,7 +207,6 @@ Overlay.prototype = {
             return;
 
         this._workspaces.hide();
-        this._sideshow.hide();
 
         // Dummy tween, just waiting for the workspace animation
         Tweener.addTween(this,
@@ -220,15 +215,16 @@ Overlay.prototype = {
                            onCompleteScope: this
                          });
     },
-    
+
     _hideDone: function() {
         let global = Shell.Global.get();
 
         this.visible = false;
         global.window_group.show();
-        this._group.lower_bottom();
         this._group.hide();
-        this._workspaces.hideDone();
+
+        this._workspaces.destroy();
+        this._workspaces = null;
     },
 
     _deactivate : function() {
index 8608e517f89e32dd2e36700053d19b5e63974e15..24c5bc70c702b52080a181942cfe482fdf7b3e0e 100644 (file)
@@ -35,19 +35,15 @@ function Workspaces(x, y, width, height) {
 
 Workspaces.prototype = {
     _init : function(x, y, width, height) {
-
-        this._group = new Clutter.Group();
+        this.actor = new Clutter.Group();
 
         this._x = x;
         this._y = y;
         this._width = width;
         this._height = height;
         this._workspaces = [];
-    },
 
-    show : function() {
         let global = Shell.Global.get();
-
         let windows = global.get_windows();
         let activeWorkspace = global.screen.get_active_workspace_index();
 
@@ -57,7 +53,7 @@ Workspaces.prototype = {
         this._workspaces = [];
         for (let w = 0; w < global.screen.n_workspaces; w++) {
             this._workspaces[w] = new Clutter.Group();
-            this._group.add_actor(this._workspaces[w]);
+            this.actor.add_actor(this._workspaces[w]);
         }
         this._createDesktopActors(windows);
 
@@ -146,8 +142,8 @@ Workspaces.prototype = {
                              });
         }
     },
-    
-    hideDone : function() {
+
+    destroy : function() {
         for (let w = 0; w < this._workspaces.length; w++) {
             this._workspaces[w].destroy();
         }